package com.example.moneybook.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.moneybook.dto.ResponseResult;
import com.example.moneybook.pojo.Bill;

import java.text.ParseException;
import java.util.List;

public interface DetailService extends IService<Bill> {

    /**
     *加载账单列表
     * @param userId
     * @param billDate
     * @return
     */
    ResponseResult load(String userId,String billDate) throws ParseException;

    /**
     * 添加账单
     * @param bill
     * @return
     */
    ResponseResult addDetail(Bill bill, String accountName);

    /**
     * 获取某个账户的账单
     * @param userId
     * @param accountId
     * @return
     */
    List<Bill> detailByAccount(String userId, int accountId);

    /**
     * 更改账单
     * @param bill
     * @return
     */
    ResponseResult updateBill(Bill bill, String accountName);

    /**
     * 删除账单
     * @param userId
     * @param billId
     * @return
     */
    ResponseResult deleteBill(String userId, int billId);

    /**
     * 更新收支信息关联的账户信息
     * @param userId
     * @param accountId
     * @return
     */
    int updateBillByAcc(String userId, int accountId);
}
